/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import javax.swing.ImageIcon;
import utility.ImageToolbox;

/**
 *
 * @author Jeppe
 */
public class Kort {
    private Suit mySuit;
    private int myNumber;
    private ImageIcon imgIcon;
    
    
    public Kort(Suit aSuit, int aNumber){
        this.mySuit = aSuit;
        
        if (aNumber >=1 && aNumber<=13){
            this.myNumber= aNumber;
        }else{
            System.err.println(aNumber + "er et ugyldigt kortnummer");
            System.exit(1);
            }
        imgIcon = new ImageIcon(getClass().getResource("/images/"+mySuit+myNumber+".png"));
    }
    
    public int getNumber(){
        return myNumber;
        }
    public Suit getSuit(){
        return this.mySuit;
    }
    
    public ImageIcon getImageIcon(){        
       return imgIcon;
    }
    
    public String toString(){            
        String numStr = "error";
        //int points=0;
        switch(this.myNumber){
        
        case 1:
            numStr = "Es";
            //points = 15;
            break;  
        case 2:
            numStr = "to";
            //points = 25;
            break;
        case 3:
            numStr = "tre";
            //points = 5;
            break;
        case 4:
            numStr = "fire";
            //points = 5;
            break;
        case 5:
            numStr = "fem";
            //points = 5;
            break;
        case 6:
            numStr = "seks";
            //points = 5;
            break;
        case 7:
            numStr = "syv";
            //points = 5;
            break;
        case 8:
            numStr = "otte";
            //points = 25;
            break;
        case 9:
            numStr = "ni";
            //points = 5;
            break;
        case 10:
            numStr = "ti";
            //points = 10;
            break;
        case 11:
            numStr = "Knægt";
            //points = 10;
            break;
        case 12:
            numStr = "Dame";
            //points = 10;
            break;
        case 13:
            numStr = "Konge";
            //points = 10;
            break;        
        }
        
        return mySuit.toString() + " "+ numStr + "\n";
    }
    public String toString(boolean whether){
            
        String numStr = "error";
        //int points=0;
        switch(this.myNumber){
        
        case 1:
            numStr = "Es";
            //points = 15;
            break;  
        case 2:
            numStr = "to";
            //points = 25;
            break;
        case 3:
            numStr = "tre";
            //points = 5;
            break;
        case 4:
            numStr = "fire";
            //points = 5;
            break;
        case 5:
            numStr = "fem";
            //points = 5;
            break;
        case 6:
            numStr = "seks";
            //points = 5;
            break;
        case 7:
            numStr = "syv";
            //points = 5;
            break;
        case 8:
            numStr = "otte";
            //points = 25;
            break;
        case 9:
            numStr = "ni";
            //points = 5;
            break;
        case 10:
            numStr = "ti";
            //points = 10;
            break;
        case 11:
            numStr = "Knægt";
            //points = 10;
            break;
        case 12:
            numStr = "Dame";
            //points = 10;
            break;
        case 13:
            numStr = "Konge";
            //points = 10;
            break;        
        }
        
        return mySuit.toString() + " "+ numStr;
    }
}
